var aUi = aUi || {};
aUi.returngoods = {
	// 增加架位
	_addShelf: function() {
		var html = '<div class="margin"></div>' +
			'<div class="house-positon"><div class="header-title">架位</div>' +
			'<div class="input-block"><div class="mui-input-row mui-plus-visible input-div">' +
			'<input id="search" type="search" class=" input-content" placeholder="请输入架位编码">' +
			'	</div><div class="mui-icon-extra mui-icon-extra-sweep sweep-icon"></div>' +
			'</div>' +
			'</div>' +
			'<div class="margin"></div>' +
			'<div class="house-positon">' +
			'<div class="header-title">数量</div>' +
			'	<div class="input-block">' +
			'	<div class="mui-input-row mui-plus-visible input-div">' +
			'<input id="search" type="search" class=" input-content" placeholder="请输入数量">' +
			'</div>' +
			'</div>' +
			'</div>';
		return html;
	},
	// 增加物料
	_addMaterials: function() {
		var html = '<ul id="picking0" class="mui-table-view materials-ul">' +
			'<li class="mui-table-view-cell mui-media supplier">' +
			'<div id="pickingli0">' +
			'<div class="margin"></div>' +
			'<div class="house-positon">' +
			'<div class="header-title">物料</div>' +
			'<div class="input-block">' +
			'<div class="mui-input-row mui-plus-visible input-div">' +
			'<input id="search" type="search" class=" input-content" placeholder="请输入物料单号">' +
			'</div>' +
			'<div class="mui-icon-extra mui-icon-extra-sweep sweep-icon"></div>' +
			'</div>' +
			'</div>' +
			'<div class="margin"></div>' +
			'<div class="house-positon">' +
			'<div class="header-title">架位</div>' +
			'<div class="input-block">' +
			'<div class="mui-input-row mui-plus-visible input-div">' +
			'<input id="search" type="search" class=" input-content" placeholder="请输入架位编码">' +
			'</div>' +
			'<div class="mui-icon-extra mui-icon-extra-sweep sweep-icon"></div>' +
			'</div>' +
			'</div>' +
			'<div class="margin"></div>' +
			'<div class="house-positon">' +
			'<div class="header-title">数量</div>' +
			'<div class="input-block">' +
			'<div class="mui-input-row mui-plus-visible input-div">' +
			'<input id="search" type="search" class=" input-content" placeholder="请输入数量">' +
			'</div>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'<div class="item-bottom">' +
			'<div class="add-item">' +
			'<div class="add-icon">' +
			'<img src="../../../images/comman/icon-plus.png" >' +
			'</div>' +
			'<div class="add-title">&nbsp其他架位拣货</div>' +
			'</div>' +
			'<button  data-id="confirm" type="button" class="mui-btn confirm">确定拣货</button>' +
			'</div>' +
			'</li>' +
			'</ul>';
		return html;
	},

	_addpick: function(data) {
		var html = '<li class="mui-table-view-cell">' +
			'<div class="content-mid">' +
			'<div class="left-image">' +
			'<img class="" src="../../../images/comman/icon_materials.png">' +
			'</div>' +
			'<div class="mid-text">' +
			'<div class="left-text">' +
			'<p class="cell-title">' + data.commodityname + '</p>' +
			'<p class="cell-time">' + data.locatorname + '</p>' +
			'</div>' +
			'<div class="right-text">' +
			'<p>x' + data.qty + '</p>' +
			'<p>' + data.locatorcode + '</p>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'</li>';
		return html;
	},
	_addpick2: function(data) {
		var html = '<li class="mui-table-view-cell">' +
			'<div class="content-mid">' +
			'<div class="left-image">' +
			'<img class="" src="../../../../images/comman/icon_materials.png">' +
			'</div>' +
			'<div class="mid-text">' +
			'<div class="left-text">' +
			'<p class="cell-title">' + data.commodityname + '</p>' +
			'<p class="cell-time">' + data.locatorname + '</p>' +
			'</div>' +
			'<div class="right-text">' +
			'<p>x' + data.qty + '</p>' +
			'<p>' + data.locatorcode + '</p>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'</li>';
		return html;
	},

	_detail: function(data) {
		var html = '<li class="mui-table-view-cell">' +
			'<div class="content-mid">' +
			'<div class="left-image">' +
			'<img class="" src="../../../images/comman/icon_materials.png">' +
			'</div>' +
			'<div class="mid-text">' +
			'<div class="left-text">' +
			'<p class="cell-title">' + data.commodityname + '</p>' +
			'<p class="cell-time">' + data.updator + '</p>' +
			'</div>' +
			'<div class="right-text">' +
			'<p>x' + data.qty + '</p>' +
			'<p>' + data.createtime + '</p>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'</li>';
		return html;
	},


	//拣货详情列表
	_addPickDetail: function(data, dataed) {
		var pickDetailQty = "0";
		var color = "#FC5959";
		var state = "未完成";
		var none = ";"
		if (data.pickDetailQty != null) {
			pickDetailQty = data.pickDetailQty;
		}
		var remainAmount = parseInt(data.qty) - parseInt(pickDetailQty);
		if (remainAmount == 0) {
			state = "已完成";
			color = "#0091FF"
			none = "none";
		} else if (remainAmount < 0) {
			state = "已超过";
			color = "#00A651"
		}
		var html = '<li  data-pickDetailQty="' + data.pickDetailQty + '" data-commodityname="' + data.commodityname + '"  data-qty="' + data.qty + '"  data-commoditybar="' +
			data.commoditybar + '" data-locatorcode="' +
			data.locatorcode +
			'" class="mui-table-view-cell mui-media item-cell" style="display:'+none+';">' +
			'<div class="content-top">' +
			'<div class="top-title">商品编码：' + data.commoditybar + '</div>' +
			'</div>' +
			'<div class="top-line"></div>' +
			'<div class="content-mid">' +
			'<div class="left-image">' +
			'<img class="" src="../../../images/comman/icon_materials.png">' +
			'</div>' +
			'<div class="mid-text">' +
			'<div class="left-text">' +
			'<p class="cell-title">' + data.commodityname + '</p>' +
			'<p class="cell-time"></p>' +
			'</div>' +
			'<div class="right-text">' +
			'<p  style="color:' + color + '">' + state + '</p>' +
			'<p >已拣数量：' + pickDetailQty + '</p>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'<div class="top-line2"></div>' +
			'<div class="bottom-content">' +
			'<div class="user">' +
			'<div class="avarimage">' +
			'<img class="" src="../../../images/comman/icon_location.png">' +
			'</div>' +
			'<div class="name">' + data.locatorname + '&nbsp&nbsp&nbsp'+data.locatorcode+'</div>' +
			'</div>' +
			'<div class="time">总拣货数量：' + data.qty + '</div>' +
			'</div>' +
			'</li>';
		return html;
	},
	
	//拣货详情列表
	_addPickDetailGoods: function(data, dataed) {
		var pickDetailQty = "0";
		var color = "#FC5959";
		var state = "未完成";
		if (data.pickDetailQty != null) {
			pickDetailQty = data.pickDetailQty;
		}
		var remainAmount = parseInt(data.qty) - parseInt(pickDetailQty);
		if (remainAmount == 0) {
			state = "已完成";
			color = "#0091FF"
		} else if (remainAmount < 0) {
			state = "已超过";
			color = "#00A651"
		}
		var html = '<li  data-pickDetailQty="' + data.pickDetailQty + '" data-commodityname="' + data.commodityname + '"  data-qty="' + data.qty + '"  data-commoditybar="' +
			data.commoditybar + '" data-locatorcode="' +
			data.locatorcode +
			'" class="mui-table-view-cell mui-media item-cell" style="display:;">' +
			'<div class="content-top">' +
			'<div class="top-title">商品编码：' + data.commoditybar + '</div>' +
			'</div>' +
			'<div class="top-line"></div>' +
			'<div class="content-mid">' +
			'<div class="left-image">' +
			'<img class="" src="../../../../images/comman/icon_materials.png">' +
			'</div>' +
			'<div class="mid-text">' +
			'<div class="left-text">' +
			'<p class="cell-title">' + data.commodityname + '</p>' +
			'<p class="cell-time"></p>' +
			'</div>' +
			'<div class="right-text">' +
			'<p  style="color:' + color + '">' + state + '</p>' +
			'<p >已拣数量：' + pickDetailQty + '</p>' +
			'</div>' +
			'</div>' +
			'</div>' +
			'<div class="top-line2"></div>' +
			'<div class="bottom-content">' +
			'<div class="user">' +
			'<div class="avarimage">' +
			'<img class="" src="../../../../images/comman/icon_location.png">' +
			'</div>' +
			'<div class="name">' + data.locatorname + '&nbsp&nbsp&nbsp'+data.locatorcode+'</div>' +
			'</div>' +
			'<div class="time">总拣货数量：' + data.qty + '</div>' +
			'</div>' +
			'</li>';
		return html;
	},

	detailList: function(list) {
		var html = "";
		for (var i = 0; i < list.length; i++) {
			var data = list[i];
			html += this._addpick(data);
		}
		return html;
	},
	detailList2: function(list) {
		var html = "";
		for (var i = 0; i < list.length; i++) {
			var data = list[i];
			html += this._addpick2(data);
		}
		return html;
	},



	shelf: function() {

		return this._addShelf();
	},

	materials: function() {

		return this._addMaterials();
	},

	pickDetail: function(list, listed) {

		var html = "";
		for (var i = 0; i < list.length; i++) {
			var data = list[i];
			html += this._addPickDetail(data, listed);
		}
		return html;
	},
	
	pickDetailGoods: function(list, listed) {
		var html = "";
		for (var i = 0; i < list.length; i++) {
			var data = list[i];
			html += this._addPickDetailGoods(data, listed);
		}
		return html;
	}
};
